<?php
/**
 * Link Management Administration Screen.
 */
/** Load WordPress Administration Bootstrap */
require_once ('admin.php');
global $current_user;
$featured = DealFlight::FEATURED_NO;
?>
<?php
$wp_list_table = _get_list_table('WP_Links_List_Table');
$doaction = $wp_list_table->current_action();

if ($doaction && isset($_REQUEST['linkcheck'])) {
    check_admin_referer('bulk-bookmarks');
    if ('delete' == $doaction) {
        $bulklinks = (array) $_REQUEST['linkcheck'];
        foreach ($bulklinks as $link_id) {
            $link_id = (int) $link_id;
            wp_delete_link($link_id);
        }
        wp_redirect(add_query_arg('deleted', count($bulklinks), admin_url('link-manager.php')));
        exit;
    }
} elseif (!empty($_GET['_wp_http_referer'])) {
    wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI'])));
    exit;
}
$wp_list_table->prepare_items();
$title = __('Customer');
$this_file = $parent_file = 'list_product.php';
get_current_screen()->add_help_tab(array(
    'id' => 'overview',
    'title' => __('Overview'),
    'content' =>
    '<p>' . sprintf(__('You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.'), 'widgets.php') . '</p>' .
    '<p>' . __('Links may be separated into Link Categories; these are different than the categories used on your posts.') . '</p>' .
    '<p>' . __('You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.') . '</p>'
));

get_current_screen()->add_help_tab(array(
    'id' => 'deleting-links',
    'title' => __('Deleting Links'),
    'content' =>
    '<p>' . __('If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.') . '</p>'
));



get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
        '<p>' . __('<a href="http://codex.wordpress.org/Links_Screen" target="_blank">Documentation on Managing Links</a>') . '</p>' .
        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);


if (!current_user_can('read'))
    wp_die(__("You do not have sufficient permissions to edit the links for this site."));
?>
<?php
if (isset($_REQUEST['deleted'])) {
    echo '<div id="message" class="updated"><p>';
    $deleted = (int) $_REQUEST['deleted'];
    printf(_n('%s link deleted.', '%s links deleted', $deleted), $deleted);
    echo '</p></div>';
    $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
}


$sucessful = 0;
$error = array();
$fileName = '';
$ok = 1;
/*
 * Submit
 */
if (isset($_REQUEST['publish_product'])) {

    if ($_REQUEST['typeFlights'] == "") {
        $error['typeFlights'] = "Type Flights can not be blank";
        $ok = 0;
    }
    if ($_REQUEST['start-location'] == "") {
        $error['start_location'] = "Leaving from can not be blank";
        $ok = 0;
    }
    if ($_REQUEST['end_location'] == "") {
        $error['end_location'] = 'Going to can not be blank';
        $ok = 0;
    }
   
    
    if ($ok == 1) {
        $sucessful = 1;
        // exit();
        if($_REQUEST['typeFlights'] == 3)
        {
             RequestAQoute::updateRequestAqoute($_REQUEST['i'], $_REQUEST['typeFlights'],$_REQUEST['start-location'], $_REQUEST['end_location'],$_REQUEST['start_time'],$_REQUEST['end_time'],$_REQUEST['adult'], $_REQUEST['children'],$_REQUEST['infant'], $_REQUEST['class'],$_REQUEST['city']);
       
        }
        else
        {
        RequestAQoute::updateRequestAqoute($_REQUEST['i'], $_REQUEST['typeFlights'],$_REQUEST['start-location_oneway'], $_REQUEST['end_location_oneway'],$_REQUEST['start_time_oneway'],$_REQUEST['end_time_oneway'],$_REQUEST['adult'], $_REQUEST['children'],$_REQUEST['infant'], $_REQUEST['class'],$_REQUEST['city']);
        }

        // wp_redirect(admin_url() . 'travel-group-list.php');
    }
}



if (isset($_GET['i'])) {
    $id = $_GET['i'];
    $AQouteInfo = RequestAQoute::listRequestAqouteByIdRequestAquote($id);
    if ($AQouteInfo) {
        
    } else {
        wp_redirect('404.php');
    }
} else {
    wp_redirect('404.php');
}
?>    

<?php include_once ('./admin-header.php'); ?>
<link rel="stylesheet" type="text/css" href="css/tuan.css"/>
<link rel="stylesheet" type="text/css" href="css/tham.css">  
<div class="wrap nosubsub">
    <h2>Update Travel Group
        <?php
        if (!empty($_REQUEST['s']))
            printf('<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html(wp_unslash($_REQUEST['s'])));
        ?>
    </h2>
    <form id="posts-filter" method="post"  enctype="multipart/form-data"> 
        <?php $wp_list_table->search_box(__('Search Links'), 'link'); ?>
        <hr>

        <?php
        if ($sucessful == 1) {
            ?>
            <div class="div_sucess">You have updated successfully</div>
            <?php
        }
        ?>
        <div style="width:100%; background:#FDFDFD">
            <table width="707"  height="77" cellspacing="0" class="frm-travel-group" >
                <tr>
                    <th width="138" valign="top"  scope="row" align="left">
                        <label for="siteupdates">
                            <p class="labelp"><?php _e('Type flights') ?> (*)</p>  
                        </label>
                    </th>
                    <td width="563"  valign="top">
                        <div style="margin-top:10px;">:  			    
                            <?php
                            $typeflights = $AQouteInfo[0]->type_flights;
                            ?>
                            <input <?php
                            if ($typeflights == DealFlight::ONEWAY) {
                                echo ' checked="checked"  ';
                            }
                            ?> type="radio" name="typeFlights" id="typeFlights1" value="<?php echo DealFlight::ONEWAY; ?>" />
                            <label class="label-flights">One Way</label>
                            <input <?php
                            if ($typeflights == DealFlight::ROUNDTRIP) {
                                echo ' checked="checked"  ';
                            }
                            ?>   type="radio" name="typeFlights" id="typeFlights2" value="<?php echo DealFlight::ROUNDTRIP; ?>" />
                            <label class="label-flights" >Round Trip</label>
                            <input  <?php
                            if ($typeflights == DealFlight::MULTICITY) {
                                echo ' checked="checked"  ';
                            }
                            ?>  type="radio" name="typeFlights" id="typeFlights3" value="<?php echo DealFlight::MULTICITY; ?>" />
                            <label  class="label-flights2" >Multi City</label> 
                            <span class="errorclass"><Br/><?php echo $error['typeFlights']; ?></span>

                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="5">
                        <table id="divloaction1">
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Leaving from') ?></p> 
                                </label>

                            </th>
                            <td width="563"  valign="top"  class="td-type-flight"> :
                                <input  style="width: 80%"  value="<?php
                                echo $AQouteInfo[0]->start_location;
                                ?>" placeholder="Enter City/airport" type="text"
                                        id="start-location" name="start-location_oneway"><br/>
                                <p class="errorclass" >

                                    <?php echo $error['start_location'];
                                    ?>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Going to') ?></p> 
                                </label>
                            </th>
                            <td width="563"  valign="top" class="td-type-flight" >
                                :<input  style="width: 80%" value="<?php
                                echo $AQouteInfo[0]->end_location;
                                ?>" placeholder="Enter City/airport" type="text" 
                                         id="end_location" name="end_location_oneway"><br/>
                                <p class="errorclass"><?php echo $error['end_location']; ?></p>
                            </td>
                        </tr>


                        <tr>
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Departure date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->start_time;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                                if($day == '00/00/0000'){}
                                 else { echo $day;}
                               
                                ?>" id="start_time"    type="text" name="start_time_oneway" />
                                <img id="image_bt_start_time" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['start_time']; ?></p>
                            </td>
                        </tr>
                        <tr id="return_date1">
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Return date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->end_time;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                                  if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="end_time"  type="text" name="end_time_oneway" />
                                <img id="image_bt_end_time" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['end_time']; ?></p>
                            </td>
                        </tr>
                        </table>
                   </td>
                </tr>
                <tr id="divloaction_muti">
                    <td colspan="5">
                        <table >
                           
                           
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Leaving from') ?></p> 
                                </label>

                            </th>
                            <td width="563"  valign="top"  class="td-type-flight"> :
                                <input  style="width: 80%"  value="<?php
                                echo $AQouteInfo[0]->start_location1;
                                ?>" placeholder="Enter City/airport" type="text"
                                        id="start-location1" name="start-location[]"><br/>
                                <p class="errorclass" >

                                    <?php echo $error['start_location1'];
                                    ?>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Going to') ?></p> 
                                </label>
                            </th>
                            <td width="563"  valign="top" class="td-type-flight" >
                                :<input  style="width: 80%" value="<?php
                                echo $AQouteInfo[0]->end_location1;
                                ?>" placeholder="Enter City/airport" type="text" 
                                         id="end_location1" name="end_location[]"><br/>
                                <p class="errorclass"><?php echo $error['end_location1']; ?></p>
                            </td>
                        </tr>

                          
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Departure date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->start_time1;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                                if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="start_time1"    type="text" name="start_time[]" />
                                <img id="image_bt_start_time1" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['start_time1']; ?></p>
                            </td>
                        </tr>
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Return date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->end_time1;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                                if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="end_time1"  type="text" name="end_time[]" />
                                <img id="image_bt_end_time1" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['end_time1']; ?></p>
                            </td>
                        </tr>
                        <tr><td colspan="5"><hr/></td></tr>
                             
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Leaving from') ?></p> 
                                </label>

                            </th>
                            <td width="563"  valign="top"  class="td-type-flight"> :
                                <input  style="width: 80%"  value="<?php
                                echo $AQouteInfo[0]->start_location2;
                                ?>" placeholder="Enter City/airport" type="text"
                                        id="start-location2" name="start-location[]"><br/>
                                <p class="errorclass" >

                                    <?php echo $error['start_location2'];
                                    ?>
                                </p>
                            </td>
                        </tr>
                        
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Going to') ?></p> 
                                </label>
                            </th>
                            <td width="563"  valign="top" class="td-type-flight" >
                                :<input  style="width: 80%" value="<?php
                                echo $AQouteInfo[0]->end_location2;
                                ?>" placeholder="Enter City/airport" type="text" 
                                         id="end_location2" name="end_location[]"><br/>
                                <p class="errorclass"><?php echo $error['end_location2']; ?></p>
                            </td>
                        </tr>


                        <tr>
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Departure date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->start_time2;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                              if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="start_time2"    type="text" name="start_time[]" />
                                <img id="image_bt_start_time2" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['start_time2']; ?></p>
                            </td>
                        </tr>
                        <tr >
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Return date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->end_time2;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                              if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="end_time2"  type="text" name="end_time[]" />
                                <img id="image_bt_end_time2" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['end_time2']; ?></p>
                            </td>
                        </tr>
                        
                        
                        
                        <tr><td colspan="5"><hr/></td></tr>
                         <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Leaving from') ?></p> 
                                </label>

                            </th>
                            <td width="563"  valign="top"  class="td-type-flight"> :
                                <input  style="width: 80%"  value="<?php
                                echo $AQouteInfo[0]->start_location2;
                                ?>" placeholder="Enter City/airport" type="text"
                                        id="start-location2" name="start-location[]"><br/>
                                <p class="errorclass" >

                                    <?php echo $error['start_location2'];
                                    ?>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Going to') ?></p> 
                                </label>
                            </th>
                            <td width="563"  valign="top" class="td-type-flight" >
                                :<input  style="width: 80%" value="<?php
                                echo $AQouteInfo[0]->end_location2;
                                ?>" placeholder="Enter City/airport" type="text" 
                                         id="end_location2" name="end_location[]"><br/>
                                <p class="errorclass"><?php echo $error['end_location2']; ?></p>
                            </td>
                        </tr>


                        <tr>
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Departure date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->start_time3;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                               if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="start_time3"    type="text" name="start_time[]" />
                                <img id="image_bt_start_time3" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['start_time3']; ?></p>
                            </td>
                        </tr>
                        <tr >
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Return date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->end_time3;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                                if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="end_time3"  type="text" name="end_time[]" />
                                <img id="image_bt_end_time3" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['end_time3']; ?></p>
                            </td>
                        </tr>
                        
                        
                        <tr><td colspan="5"><hr/></td></tr>
                         <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Leaving from') ?></p> 
                                </label>

                            </th>
                            <td width="563"  valign="top"  class="td-type-flight"> :
                                <input  style="width: 80%"  value="<?php
                                echo $AQouteInfo[0]->start_location4;
                                ?>" placeholder="Enter City/airport" type="text"
                                        id="start-location4" name="start-location[]"><br/>
                                <p class="errorclass" >

                                    <?php echo $error['start_location4'];
                                    ?>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <th width="138" valign="top"  scope="row" align="left">
                                <label for="siteupdates">
                                    <p class="labelp" ><?php _e('Going to') ?></p> 
                                </label>
                            </th>
                            <td width="563"  valign="top" class="td-type-flight" >
                                :<input  style="width: 80%" value="<?php
                                echo $AQouteInfo[0]->end_location4;
                                ?>" placeholder="Enter City/airport" type="text" 
                                         id="end_location4" name="end_location[]"><br/>
                                <p class="errorclass"><?php echo $error['end_location4']; ?></p>
                            </td>
                        </tr>


                        <tr>
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Departure date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->start_time4;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                                if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="start_time4"    type="text" name="start_time[]" />
                                <img id="image_bt_start_time4" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['start_time4']; ?></p>
                            </td>
                        </tr>
                        <tr >
                            <th width="138" valign="top"  scope="row" align="left" >
                                <label for="siteupdates"> Return date</label>
                            </th>
                            <td width="563"  valign="top" >
                                <input  value="<?php
                                $startdate = $AQouteInfo[0]->end_time4;
                                $Liststartdate = @explode(" ", $startdate);
                                //echo $Liststartdate;
                                $days = @$Liststartdate[0];
                                $days = explode("-", $days);
                                $day = @$days[2] . "/" . @$days[1] . "/" . @$days[0];
                                $house = @$Liststartdate[1];
                                $listHouser = @explode(':', $house);
                                $house = @$listHouser[0] . ":" . @$listHouser[1];
                               if($day == '00/00/0000'){}
                                 else { echo $day;}
                                ?>" id="end_time4"  type="text" name="end_time[]" />
                                <img id="image_bt_end_time4" width="20px;" src="<?php echo get_template_directory_uri(); ?>/images/icon_datetime.png"/>
                                <p class="errorclass"><?php echo $error['end_time4']; ?></p>
                            </td>
                        </tr>
                        
                        
                        </table>
                        
                    </td>
                </tr>
                

                <tr>
                    <th width="138" valign="top"  scope="row" align="left" >
                        <label for="siteupdates">Adult(12+) </label>
                    </th>
                    <td width="563"  valign="top" >
                        <?php
                        $adult = $AQouteInfo[0]->adult;
                        ?>


                        <select  id="adult" name="adult" class="select-find-flights" >
                            <?php
                            for ($i = 1; $i <= 9; $i++) {
                                if ($adult == $i) {
                                    echo '<option selected=selected value="' . $i . '" >' . $i . '</option>';
                                } else {
                                    echo '<option value="' . $i . '" >' . $i . '</option>';
                                }
                            }
                            ?>
                        </select>
                    </td>
                </tr>
                
                
                
                <tr>
                    <th width="138" valign="top"  scope="row" align="left" >
                        <label for="siteupdates">Children(2-12)</label>
                    </th>
                    <td width="563"  valign="top" >
                        <?php
                        $children = $AQouteInfo[0]->children;
                        ?>
                        <select  id="children" name="children" class="select-find-flights" >
                            <?php
                            for ($i = 0; $i < 9; $i++) {

                                if ($i == $children) {

                                    echo '<option selected=selected  value="' . $i . '" >' . $i . '</option>';
                                } else {
                                    echo '<option value="' . $i . '" >' . $i . '</option>';
                                }
                            }
                            ?>
                        </select>
                    </td>
                </tr>
                 <tr>
                    <th width="138" valign="top"  scope="row" align="left" >
                        <label for="siteupdates">Infant(0-2)</label>
                    </th>
                    <td width="563"  valign="top" >
                        <?php $infant = $AQouteInfo[0]->infant; ?>
                        <select id="infant" name="infant"  class="select-find-flights">

                            <option <?php
                            if ($infant == 0) {
                                echo 'selected=selected';
                            }
                            ?> >0</option>
                            <option <?php
                            if ($infant == 1) {
                                echo 'selected=selected';
                            }
                            ?> >1</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th width="138" valign="top"  scope="row" align="left" >
                        <label for="siteupdates" >Class</label>
                    </th>
                    <td width="563"  valign="top" >
                        <?php $class_f = $AQouteInfo[0]->class; ?>
                        <select name="class" id="class" class="select-find-flights">
                            <option value="<?php echo DealFlight::ECONOMY; ?>"  
                            <?php
                            if ($class_f == DealFlight::ECONOMY) {
                                echo 'selected=selected';
                            }
                            ?>>Economy</option>
                            <option value="<?php echo DealFlight::BUSINESS; ?>" 
                            <?php
                            if ($class_f == DealFlight::BUSINESS) {
                                echo 'selected=selected';
                            }
                            ?> >Business</option>
                            <option value="<?PHP echo DealFlight::FIRST_CLASS; ?>" 
                            <?php
                            if ($class_f == DealFlight::FIRST_CLASS) {
                                echo 'selected=selected';
                            }
                            ?> >First Class</option>
                            <option value="<?php echo DealFlight::PREMIUM_ECONOMY; ?>"

                                    <?php
                                    if ($class_f == DealFlight::PREMIUM_ECONOMY) {
                                        echo 'selected=selected';
                                    }
                                    ?> >Premium Economy</option>
                        </select>
                    </td>
                </tr>
                 <tr>
                    <th width="138" valign="top"  scope="row" align="left" >
                        <label for="siteupdates">City</label>
                    </th>
                    <td width="563"  valign="top" >

                        <select name="city" id="city" class="select-find-flights" >
                            <?php
                             $city = $AQouteInfo[0]->city;
                             
                            ?>
     
                            <option  <?php if($city=='USA'){
                                echo 'selected="selected"';
                                
                                }  ?> value="USA">USA</option>
                           
                            <option  <?php if($city=='India'){
                                echo 'selected="selected"';
                                
                                }  ?> value="India">India</option>
                            
                             <option value="Dubai"  <?php if($city=='Arab'){
                                echo 'selected="selected"';
                                
                                }  ?> > Dubai </option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th valign="top"  scope="row" align="left">&nbsp;</th>
                    <td  valign="top"><div style="margin-top:10px; margin-left:5px;">
                            <input type="submit" name="publish_product" id="publish_product" 
                                   class="button button-primary button-large"
                                   value="UPDATE" accesskey="p" ></div>
                    </td>
                </tr>
            </table>
        </div>
    </form>

</div>

<link rel="stylesheet" type="text/css" href="../wp-content/themes/travel_donald/css/jquery.datetimepicker.css" />
<script src="../wp-content/themes/travel_donald/js/jquery.js"></script>
<script src="../wp-content/themes/travel_donald/js/jquery.datetimepicker.js"></script>

<script type="text/javascript" lang="javascript">
    
  window.onload=function(){
       //alert('AAAAAAAAA');
        var typeFlights = 0;
        if ($('#typeFlights1').is(":checked"))
        {
            typeFlights = 1;

        }
        if ($('#typeFlights2').is(":checked"))
        {
            typeFlights = 2;

        }
        if ($('#typeFlights3').is(":checked"))
        {
            typeFlights = 3;

        }
        // alert(typeFlights);
        if(typeFlights == 1)
        {
             $('#return_date1').hide();
             $("#divloaction1").show();
             $('#divloaction_muti').hide();
        }
        else if(typeFlights == 2)
        {
            $('#return_date1').show();
            $("#divloaction1").show();
            $('#divloaction_muti').hide();
           
        }
        else
        {
             $("#divloaction1").hide();
       $('#divloaction_muti').show();
        }
  };
 
   $("#typeFlights1").click(function(){
     
     
       
             $('#return_date1').hide();
             $("#divloaction1").show();
             $('#divloaction_muti').hide();
    });
   $("#typeFlights2").click(function(){
           $('#return_date1').show();
           $("#divloaction1").show();
           $('#divloaction_muti').hide();
   });
   
   $("#typeFlights3").click(function(){
       $("#divloaction1").hide();
       $('#divloaction_muti').show();
   });
   

   
    $('#image_bt_start_time').click(function() {
        $('#start_time').datetimepicker('show'); //support hide,show and destroy command
    });


    

    $('#image_bt_end_time').click(function() {
        $('#end_time').datetimepicker('show'); //support hide,show and destroy command
    });
    
     $(function() {
        $('#start_time').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    maxDate: $('#end_time').val() ? $('#end_time').val() : false
                })
            },
            timepicker: false
        });
        $('#end_time').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    minDate: $('#start_time').val() ? $('#start_time').val() : false
                })
            },
            timepicker: false
        });
    });
    
    
    
     
    $('#image_bt_start_time1').click(function() {
        $('#start_time1').datetimepicker('show'); //support hide,show and destroy command
    });


    

    $('#image_bt_end_time1').click(function() {
        $('#end_time1').datetimepicker('show'); //support hide,show and destroy command
    });
    
     $(function() {
        $('#start_time1').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    maxDate: $('#end_time1').val() ? $('#end_time1').val() : false
                })
            },
            timepicker: false
        });
        $('#end_time1').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    minDate: $('#start_time1').val() ? $('#start_time1').val() : false
                })
            },
            timepicker: false
        });
    });
   
   
   
    $('#image_bt_start_time2').click(function() {
        $('#start_time2').datetimepicker('show'); //support hide,show and destroy command
    });


    

    $('#image_bt_end_time2').click(function() {
        $('#end_time2').datetimepicker('show'); //support hide,show and destroy command
    });
    
     $(function() {
        $('#start_time2').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    maxDate: $('#end_time2').val() ? $('#end_time2').val() : false
                })
            },
            timepicker: false
        });
        $('#end_time2').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    minDate: $('#start_time2').val() ? $('#start_time2').val() : false
                })
            },
            timepicker: false
        });
    });
   
   
   $('#image_bt_start_time3').click(function() {
        $('#start_time3').datetimepicker('show'); //support hide,show and destroy command
    });


    

    $('#image_bt_end_time3').click(function() {
        $('#end_time3').datetimepicker('show'); //support hide,show and destroy command
    });
    
     $(function() {
        $('#start_time3').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    maxDate: $('#end_time3').val() ? $('#end_time3').val() : false
                })
            },
            timepicker: false
        });
        $('#end_time3').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    minDate: $('#start_time3').val() ? $('#start_time3').val() : false
                })
            },
            timepicker: false
        });
    });
    
    
   $('#image_bt_start_time3').click(function() {
        $('#start_time4').datetimepicker('show'); //support hide,show and destroy command
    });


    

    $('#image_bt_end_time4').click(function() {
        $('#end_time4').datetimepicker('show'); //support hide,show and destroy command
    });
    
     $(function() {
        $('#start_time4').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    maxDate: $('#end_time4').val() ? $('#end_time4').val() : false
                })
            },
            timepicker: false
        });
        $('#end_time4').datetimepicker({
            format: 'd/m/Y',
            onShow: function(ct) {
                this.setOptions({
                    minDate: $('#start_time4').val() ? $('#start_time4').val() : false
                })
            },
            timepicker: false
        });
    });
   
   
   



</script>



<?php
include('./admin-footer.php');
?>


